<?php


namespace CacheManage\Driver;


use CacheManage\Driver;
use CacheManage\DriverInterface;
use CacheManage\Helper;
use Illuminate\Support\Facades\Cache;

/**
 * Laraver Facades 驱动
 * Class Laravel
 * @package CacheManage\Driver
 */
class Laravel extends Driver implements DriverInterface
{

    public function has($key): bool
    {
        return Cache::has($key);
    }

    public function get($key, $default = null)
    {
        return Cache::get($key, $default);
    }

    public function set($key, $value, int $ttl = 0): bool
    {
        Cache::put($key, $value, $ttl / 60);
        return true;
    }

    public function remove($key)
    {
        return Cache::forget($key);
    }


}
